<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Articles extends Model
{
    protected $table = 'articles';
    protected $primaryKey = 'id';
    public $timestamps = true;

    public function findComments ()
    {
        return $this->hasMany('App\Model\Comments', 'article_id');
    }

    public function findCategories ()
    {
        return $this->belongsTo('App\Model\Categories', 'category_id');
    }

    public function findTags ()
    {
        return $this->belongsToMany('App\Model\Tags', 'articles_tags', 'article_id', 'tag_id');
    }




}
